package pres.lnk.learn.designpattern.h_filter.criteria;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author lnk
 * @Date 2018/2/8
 */
public abstract class AbstractCriteria<T> implements Criteria<T>{

    @Override
    public List<T> filter(List<T> list) {
        List<T> filter = new ArrayList<>();
        for (T t : list) {
            if(meet(t)){
                filter.add(t);
            }
        }
        return filter;
    }
}
